using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Sharp.Domain.PlatformBoundedContext.WorkFlowModule.Aggregates;

namespace Sharp.Domain.PlatformBoundedContext.ModelConfigurations.Workflow
{
    public partial class TransitionInstanceEntityConfiguration
        : EntityTypeConfiguration<TransitionInstanceEntity>
    {
        public TransitionInstanceEntityConfiguration()
        {
            // keys
            HasKey(t => t.Id);

            // Properties
            Property(t => t.Id)
                .IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);


            HasRequired(t => t.ToActivityInstance)
                .WithMany(t => t.TransitionInstances)
                .HasForeignKey(t=>t.ToActivityInstanceID);
             
        }
    }
}